/*
 * @Author: sunkai@xinxinapp.cn
 * @Date: 2021-03-10 16:47:55
 * @LastEditTime: 2021-03-10 16:56:23
 * @LastEditors: sunkai@xinxinapp.cn
 * @Description: 
 * @FilePath: /edu/test-serve/app.js
 */
const express = require('express')
const app = express()
const { createProxyMiddleware } = require('http-proxy-middleware')

const path = require('path')

app.use(express.static(path.join(__dirname, '../dist')))

app.use('/boss', createProxyMiddleware({
  target: 'http://eduboss.lagou.com/',
  changeOrigin: true
}))

app.use('/front', createProxyMiddleware({
  target: 'http://edufront.lagou.com',
  changeOrigin: true
}))

app.listen(3000, () => {
  console.log('running...')
})